Ext.define('cloud.view.Main', {
    extend: 'Ext.Container',
    xtype: 'main',
    requires: [
        'Ext.dataview.NestedList',
        'Ext.navigation.Bar',
        'Ext.field.Select'
    ],
    leaveid: '',
    config: {
        style: 'background:#fbfbfb',
        fullscreen: true,

        layout: {
            type: 'card',
            animation: {
                type: 'slide',
                direction: 'left',
                duration: 250
            }
        },
        items: [
//            {
//                id: 'launchscreen',
//                cls: 'card',
//                scrollable: true,
//                html: '<div style="text-align: center; font-weight: bolder; font-size: 26px; color:#41a6d5;margin-top: 200px; ">欢迎光临    --移动云平台管理系统--</div> '
//            },

            {
                xtype: 'selectfield',
                id: 'selectAreaByApp',
                docked: 'left',
                store: 'AreaStatusFindStore',
                height: 24,
                width: 100,
                style: 'float:left; position:absolute; left:210px; font-size:14px; top:8px; border:none; padding:0px;',
                displayField: 'name',
                valueField: 'cadid'
            },
            {
                id: 'mainNestedList',
                xtype: 'nestedlist',
                docked: 'left',
                width: 320,
                useTitleAsBackText: false,
                onItemDisclosure: true,
                title: localStorage.getItem('appname'),
                backText: '返回',
                getItemTextTpl: function () {
                    return  "<div style='margin-left: 20px;'>" +
                        "<span class='icon-{id}' id='{id}' style='vertical-align: middle'></span>" +
                        "<span style=' margin-left: 30px;'>{text}</span></div>"
                }
            }

        ], listeners: {
            painted: function () {
                var tree = Ext.getStore('Tree');
                tree.load({params: {
                        username: localStorage.getItem('username'),
                        caid: localStorage.getItem('caid')
                    }, callback: function (data) {
                        Ext.getCmp('mainNestedList').setStore(tree);
                    }, scope: this}
                );
            }
        }
    }
});